package com.jk.service;

import com.jk.dao.RechargeableDao;
import com.jk.entity.DetailsEntity;
import com.jk.entity.RechargeableEntity;
import com.jk.utils.ReturnMsgUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @author 纪思齐
 * @version 1.0
 * @BelongsProject: 2203java-financial
 * @BelongsPackage: com.jk.service
 * @description: TODO
 * @date 2022/11/3 21:07
 */
@Service
public class RechargeableService {

    @Autowired
    private RechargeableDao rechargeableDao;

    public List<DetailsEntity> findTypeList() {
        try {
            List<DetailsEntity> list = rechargeableDao.findTypeList();
            return list;
        }catch (Exception e){
            e.printStackTrace();
            return null;
        }
    }

    public Map getRechargeableList(RechargeableEntity rechargeableEntity) {
        try {
            List<RechargeableEntity> list = rechargeableDao.getRechargeableList(rechargeableEntity);
            return ReturnMsgUtils.returnMsg(200,"查询成功",list);
        }catch (Exception e){
            e.printStackTrace();
            return ReturnMsgUtils.returnMsg(500,"服务器错误",null);
        }
    }
}
